﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework.Media;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Controls;

namespace StaticView
{
    interface IDocument
    {
        bool RequestChange(); // Return true if there are any chance to the document
        ImageSource GetImage(); // Return the image of the document
    }

    class Photo : IDocument
    {
        BitmapImage bmp;
        bool called = false;

        public Photo()
        {
            MediaLibrary library = new MediaLibrary();
            PictureCollection pictures = library.Pictures;
            bmp = new BitmapImage();
            bmp.SetSource(pictures[0].GetImage());
        }

        public bool RequestChange()
        {
            if (!called)
            {
                called = true;
                return true;
            }
            return false;
        }

        public ImageSource GetImage()
        {
            return bmp;
        }
    }
}
